package cn.com.bluemoon.daps.api.notice.factory;

import cn.com.bluemoon.daps.api.notice.RemoteNoticeHandlerService;
import cn.com.bluemoon.daps.common.domain.ResultBean;
import cn.com.bluemoon.daps.notice.core.NoticeQueryVo;
import cn.com.bluemoon.daps.notice.core.NoticeType;
import cn.com.bluemoon.daps.notice.core.PreSendMsgInfo;
import cn.com.bluemoon.daps.notice.template.*;
import feign.hystrix.FallbackFactory;

/**
 * @author Jarod.Kong
 * @date 2021/6/11 17:23
 */
public class RemoteNoticeHandlerServiceFactory implements FallbackFactory<RemoteNoticeHandlerService> {
    @Override
    public RemoteNoticeHandlerService create(Throwable throwable) {
        return new RemoteNoticeHandlerService() {

            @Override
            public ResultBean<NoticeQueryVo> queryNoticeContentById(String msgRecordId) {
                return ResultBean.error("查询消息内容失败");
            }

            @Override
            public ResultBean<String> preSendInfo(NoticeType type, PreMetadataImpactTxtMessage baseMsg) {
                return ResultBean.error("预获取通知内容失败");
            }

            @Override
            public ResultBean<Boolean> sendMim(NoticeType type, MetadataImpactMessage baseMsg) {
                return ResultBean.error("发送表影响消息失败");
            }

            @Override
            public ResultBean<Boolean> sendDevMsg(NoticeType type, DevSyncMessage baseMsg) {
                return ResultBean.error("发送消息失败");
            }

            @Override
            public ResultBean<Boolean> sendProMsg(NoticeType type, ProSyncMessage baseMsg) {
                return ResultBean.error("发送消息失败");
            }

            @Override
            public ResultBean<Boolean> sendApplyMsg(NoticeType type, ApplyPublishMessage baseMsg) {
                return ResultBean.error("发送消息失败");
            }

            @Override
            public ResultBean<Boolean> sendSecurityApplyAuth(NoticeType type, SecurityTableApplyMessage baseMsg) {
                return ResultBean.error("发送申请表权限消息失败");
            }

            @Override
            public ResultBean<Boolean> sendSecurityApplyExport(NoticeType type, SecurityExportApplyMessage baseMsg) {
                return ResultBean.error("发送申请导出消息失败");
            }

        };
    }
}
